package com.ougy.reshop.action;

import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.Transaction;
import org.hibernate.search.FullTextSession;
import org.hibernate.search.Search;

import com.ougy.reshop.model.Publish;

public class SearchAction extends BaseAction {
	private Logger logger=Logger.getLogger(getClass());
	private List<Publish> list;
	
	private String word;

	public String getWord() {
		return word;
	}
	public void setWord(String word) {
		this.word = word;
	}

	@Override
	public String execute() throws Exception {
		logger.debug("word:"+word);
		list=sPublish.search(word);
		logger.debug("search word:"+word+",total:"+list.size());
		for(Publish pub:list){
//			logger.debug("[id:"+pub.getId()+",title:"+pub.getTitle()+",authorName:"+pub.getOwner().getUsername()+",pubGoodsClass:"+pub.getPubGoodClass().getClassName()+"]");
		}
		return SUCCESS;
	}
	public List<Publish> getList() {
		return list;
	}
	public void setList(List<Publish> list) {
		this.list = list;
	}
}
